<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page  import="java.util.*"  %>
<%@ page  import="java.sql.*"  %>
<%@page import="object.Module"%>
<%@page import="manage.BugManage"%>
<%@include file="JS/session.jsp" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>解决bug</title>
<link href="css/foreground.css" rel="stylesheet" type="text/css" />

</head>
 <link rel="StyleSheet" href="css/dtree.css" type="text/css" />
<script type="text/javascript" src="JS/for_dtree.js">
function go(obj){ 
self.location=obj.options[obj.selectedIndex].value; 
return false; 
} 
</script>
<jsp:useBean id="procedure" scope="page" class="Procedure.UseProcedure"/>  
 <BODY id=css-zen-garden>
<DIV id=container>
<DIV id=intro>
<DIV id=quickSummary>
<p class=p2>欢迎，<%=session.getAttribute("RealName") %>;<a href="login.jsp">退出</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="EditUser.jsp">修改资料</a>&nbsp;&nbsp;
    <%
     String level= null;
     level=(String)session.getAttribute("UserLevel");
     if(level!=null&&level.equals("0"))
     {
     %> 
      <a href="admin/AddGroup.jsp">进入后台</a>
      <%
       }
       %></p>
</DIV>
<DIV id=buginfo>
  <form id="ResolvedBugForm" name="ResolvedBugForm" method="post"  enctype="multipart/form-data"  action="resolvedBug">
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_style">
  <tr bgcolor="#52514E">
    <td colspan="6">解决</td>
  </tr>
  <tr bgcolor="#52514E">
    <td>解决方案</td>
    <td align="left">
      <select name="Resolution" id="Resolution">
        <option selected="selected" value="1">By Design</option>
        <option value="2">Duplicate</option>
        <option value="3">Not Repro</option>
        <option value="4">Fixed</option>
        <option value="5">External</option>
        <option value="6">Postponed</option>
        <option value="7">Won't Fix</option>
        </select></td>
  </tr>
     <tr bgcolor="#52514E">
    <td>相关Bug</td>
    <td align="left"><input type="text" name="LinkID" id="LinkID" /></td></tr> 
  <tr bgcolor="#52514E">
    <td>解决Build</td>
    <td align="left"><input type="text" name="ResolvedBuild" id="ResolvedBuild" /></td></tr>
    <tr bgcolor="#52514E">
    <td colspan="2">描述</td>
    </tr>
    <tr bgcolor="#52514E">
    <td>详细信息</td>
    <td align="left">
      <textarea name="ActionNote" id="ActionNote" cols="45" rows="10"></textarea>      </td>
  </tr>
  <tr bgcolor="#52514E">
    <td colspan="2">添加附件
     <input type="hidden" name="BugID" id="BugID" value="<%= request.getParameter("BugID") %>" />
    </td>
    
    </tr>
   <tr bgcolor="#52514E">
    <td>选择文件</td>
    <td align="left">
   <input name="filename" type="file" id="filename" size="25" maxlength="200" dataType="Require" msg="选择上传文件" /></td>
  </tr>
   <tr bgcolor="#52514E">
    <td>新文件名</td>
    <td align="left"><input name="title" type="text" id="title" size="25" maxlength="25"  dataType="Require" msg="输入题目" />
    </td>
  </tr>
  <tr bgcolor="#52514E">
    <td colspan="6" height="30px"><input  type="submit" value="解决" /></td>
  </tr>
</table>
      </form> 
</DIV></DIV>
<DIV id=supportingText>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</DIV>
<DIV id=linkList>
<DIV id=linkList2>
<DIV id=lselect>
<H3 class=select></H3>
<UL>
     <li><a href="QueryBug.jsp?QueryMode=Whole"><span 
  class=accesskey>查看BUG</span></a> </li>
     <li><a href="AddBug.jsp"><span 
  class=accesskey>创建BUG</span></a> </li>
  </UL>
</DIV>
<DIV id=larchives>
<H3 class=archives><SPAN></SPAN></H3>
<UL>
        <LI>
       <form id="Moudule" name="Mudule" method="post" action="">
          <select name="ProductList" class="treelist" id="ProcuctList" onchange="go(this)">
           <option value="0">维护项目</option>
          <%  
             String ID=(String)session.getAttribute("UserID");
           if (ID!=null)
             {
             int projectID=0;
            if(request.getParameter("projectID")!=null)
            { 
             projectID=Integer.parseInt(request.getParameter("projectID"));
            }
             int UserID=Integer.parseInt(ID);
             ResultSet rs=procedure.getProjectLists(UserID);
            while(rs.next())
          { String ProjectName=rs.getString("ProjectName");
            int ProjectID=rs.getInt("ProjectID");
            if(ProjectID==projectID)
            {
            %>
             <option value="ResolvedBug.jsp?projectID=<%= ProjectID%>&BugID=<%= request.getParameter("BugID") %> "  selected="selected"><%=ProjectName %></option>
            <% 
            }
           else
            {
           %> 
            <option value="ResolvedBug.jsp?projectID=<%= ProjectID%>&BugID=<%= request.getParameter("BugID") %> "><%=ProjectName %></option>
          <% 
            }
            }
            rs.close();
            }
          %>
          </select>
        </form>
      </LI>
      <li>
        <%    String jscode="";
	         String id=request.getParameter("projectID");
	         if(id!=null)
	         {
	          int ProjectID=Integer.parseInt(id);
	          int ModuleID;
	          ArrayList list=procedure.getModules(ProjectID);
	          if(list.size()>0)
	           {
	              for(int count=0;count<list.size();count++)
				   {		
					 Module module=(Module)list.get(count);
					 ModuleID=module.getModuleID();
					 String url="QueryBug.jsp?moduleID="+ModuleID;
						
						//jscode=jscode+"Tree["+ k +"]  = '"+ id +"|"+ pid +"|"+ name +"|"+ url +"';";
					 jscode=jscode+"d.add("+ module.getModuleID() +","+ module.getParentID() +",'"+ module.getModuleName() +"','"+ url +"');";
						
	               }
	           }
	           
	           
	           }
	         
         %>
    <div class="dtree">
         <script type="text/javascript">
		<!--

		d = new dTree('d');
		d.add(0,-1,'项目模块');//由于缺少数据库缺少pid=-1的记录这里手动添加一个。
		<%=jscode%>

		document.write(d);

		//-->
	</script>

</div>
            
      </li>
         
        </ul>
      </div>
      <div id=lresources>
        <h3 class=resources></h3>
        <ul>
          
          <li><a href="QueryBug.jsp?QueryMode=AssignedTo"><span class=accesskey>指派给我的BUG</span></a> </li>
          <li><a href="QueryBug.jsp?QueryMode=Opened"><span class=accesskey>由我创建的BUG</span></a> </li>
        </ul>
      </div>
    </div>
  </div>
</div>
     </BODY>
</html>
 
